import selfAxios from '@/utils/selfAxios';

export default {
    //获取会员列表数据
    getList() {
        return selfAxios({
            url: '/member/list',
            method: 'get',
        })
    },
    //分页搜索方法
    // page当前页码,size每页查询的条数,条件查询的条件值
    search(page, size, searchMap) {
        return selfAxios({
            url: `/member/list/search/${page}/${size}`,
            method: 'post',
            data: searchMap
        });
    },
    //新增会员信息
    add(addData) {
        return selfAxios({
            url: '/member',
            method: 'post',
            data: addData
        });
    },
    //通过ID查询会员信息
    getById(id) {
        return selfAxios({
            url: `/member/${id}`,
            method: 'get'
        });
    },
    //更新数据
    upData(pojo) {
        return selfAxios({
            url: `/member/${pojo.id}`,
            method: 'put',
            data: pojo
        });
    },
    //删除数据
    delData(id) {
        return selfAxios({
            url: `/member/${id}`,
            method: 'delete',
        })
    }
}